﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pattern_Singleton
{
    class Singleton
    {
        private static Singleton _instance;
        private string _Field = string.Empty;


        public void Display()
        {
            Console.WriteLine(_Field);
        }

        private Singleton()
        {
            _Field = "one world one dream";
        }

        static public Singleton getInstance()
        {
            if (_instance == null)
            {
                _instance = new Singleton();

                return _instance;
            }
            else
                return _instance;
        }
    }
}
